-module (sandbox).
-export( [play/0] ).


play() ->
  io:format( "Sandbox v 1.0\n" ),
  io:format( "Lists: ~p, ~p, ~p\n", [erts_debug:size([1.2]), erts_debug:size([1.0,3.0]), erts_debug:size([1.0,2.0,3.0])] ),
  io:format( "Tuples: ~p, ~p, ~p\n", [erts_debug:size({1.2}), erts_debug:size({1.0,3.0}), erts_debug:size({1.0,2.0,3.0})] ),
  
  testCondemned(),

  Vis = vis:start( {-200.0, -200.0, +200.0, +200.0} ),
  loop( Vis ).


loop( Vis ) ->
  timer:sleep( 45 ),
  loop( Vis ).


condemnedProc() ->
  receive
    ok_msg ->
      io:format( "Got OK msg\n" )
  end,
  timer:sleep( 200 ),
  io:format( "Ternimating...\n" ),
  ok.
  
testCondemned() ->
  C = spawn( fun condemnedProc/0 ),
  C ! ok_msg,
  timer:sleep( 400 ),
  C ! fail_msg,
  ok.